package com.yanqu.road.logic.pb;

import com.yanqu.road.entity.activity.luckydraw.LuckyDrawParam;
import com.yanqu.road.entity.activity.luckydraw.LuckyDrawRecord;
import com.yanqu.road.pb.activity.LuckyDrawProto;

public class LuckyDrawPb2 {

    public static LuckyDrawParam parseChannelLuckyDrawKeyMsg(LuckyDrawProto.ChannelLuckyDrawKeyMsg reqMsg) {
        LuckyDrawParam param = new LuckyDrawParam();
        param.setChannelId(reqMsg.getChannelId());
        param.setServerId(reqMsg.getServerId());
        param.setUserId(reqMsg.getUserId());
        param.setZeroTime(reqMsg.getZeroTime());
        param.setNickname(reqMsg.getNickname());
        return param;
    }

    public static LuckyDrawProto.LuckyDrawRecordMsg.Builder parseLuckyDrawRecordMsg(LuckyDrawRecord record) {
        LuckyDrawProto.LuckyDrawRecordMsg.Builder builder = LuckyDrawProto.LuckyDrawRecordMsg.newBuilder();
        builder.setGoodsId(record.getGoodsId());
        builder.setNickname(record.getNickname());
        builder.setTime(record.getTime()); // zkt wait todo 转时区
        builder.setServerId(record.getServerId());
        return builder;
    }


}
